package com.bjian.CodeSandBox.codeSandbox.impl;

import cn.hutool.core.io.FileUtil;
import com.bjian.CodeSandBox.codeSandbox.model.ExecuteCodeRequest;
import com.bjian.CodeSandBox.codeSandbox.model.ExecuteCodeResponse;

import java.util.ArrayList;
import java.util.Arrays;

public class CodeboxTest {
    public static void main(String[] args) {
        String filePath = "E:\\project\\oj_code_sandbox\\tempReadCode\\Main.java";
        // 读取文件内容并转换为字符串
        String content = FileUtil.readUtf8String(filePath);

        ArrayList<String> arrayList = new ArrayList<>(Arrays.asList("1 2", "2 3"));

        ExampleCodeSandboxImplOld exampleCodeSandbox = new ExampleCodeSandboxImplOld();
        ExecuteCodeRequest executeCodeRequest = ExecuteCodeRequest
                .builder()
                .code(content)
                .inputList(arrayList)
                .build();
        ExecuteCodeResponse executeCodeResponse = exampleCodeSandbox.executeCode(executeCodeRequest);
        System.out.println(executeCodeResponse);
    }
}
